package org.studle.services;

import java.util.Date;

import org.studle.data.GenericDAO;
import org.studle.domain.*;
import org.studle.domain.exceptions.DuplicateKeyException;

public class ProposalService {
	private static GenericDAO<String, Proposal> proposalDataAccesser 
		= new GenericDAO<String, Proposal>();

	public void createProposal(Event event, Date eventStartDate, Person party){
		Proposal proposal = new Proposal(event, eventStartDate, party);
		try{
			proposalDataAccesser.createRecord(proposal.getID(), proposal);
		} catch (DuplicateKeyException dke) {
			createProposal(event, eventStartDate, party);
		}
	}
	
}
